<?
require_once  '../classes/DisciplinaManager.php';
require_once  '../classes/DisciplinaDataManager.php';
require_once  '../classes/ConnectionDB.php';
require_once  '../classes/TestDataManager.php';
require_once '../bean/Disciplina.php';

$db =ConnectionDB::getInstance()->connectToDB();

$disciplineUtente = DisciplinaDataManager::getInstance()->getDisciplineUtente($db);
$lastQuestionCode = TestDataManager::getInstance()->getLastQuestionCode($db);
$lastQuestionCode = $lastQuestionCode -1;
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Nuovo Test - step 1 - </title>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/prototype.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/scriptaculous/effects.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/glassbox/glassbox.js" type="text/javascript"></script>
        <style type="text/css">
            @import url("../css/style.css");

            #testForm {
                padding-top: 3%;
                margin-left: -5px;
            }

            #testFormCont
            {
                padding-left: 2%;
                padding-top: 3%;
            }

            #testFormCont table
            {

            }


        </style>
        <script type="text/javascript">
            path_to_root_dir = "../glassboxLatest/glassbox.2.0.0/";
            var listaDomande;
            var numItem=10;
            var currentIndex=0;

            window.onload = function()
            {
                var testForm = new GlassBox();
                testForm.init( 'testForm', '840px', '390px', 'hidden','',true, false);
                testForm.ipos();
                testForm.appear();
            }

            function continua()
            {
                location.href="newQuestion.php";
            }

        </script>
    </head>
    <body>
        <?php include '../portal/header.php';?>
        <center>
            <div id="testForm">
                <div id="testFormCont">
                     <table cellpadding="3" style="display: block; padding-left: 55%">
                            <tr>
                                <td colspan="2">&nbsp;</td>
                                <td style="color: gray;"><strong>Step 1 - Dettaglio Domanda</strong></td>
                            </tr>
                            <tr>
                                <td colspan="2">&nbsp;</td>
                                <td style="color: #3e7ad4;">Step 2 - Upload file</td>
                            </tr>

                        </table>
                    <table style="padding-top: 20px;" cellpadding="20">
                        <tr>
                            <th>Allega un file. Premere direttamente Continua per non allegarlo.</th>
                        </tr>
                        <tr>
                            <td>
                                <form enctype="multipart/form-data" action="uploader.php" id="formUpload" method="POST">
                                    <input type="hidden" id="code" name="code" value="<?= $lastQuestionCode  ?>" />
                                    &nbsp;<input name="fileTmp" id="fileTmp" type="file"  />
                                    <input type="submit" value="Upload File" />

                                </form>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3"><input type="button" value="Continua" onclick="javascript:continua();"/></td>
                        </tr>
                    </table>
                </div>
            </div>
        </center>
    </body>
</html>
